package com.xx.pmis.services.implementations;

import java.util.List;

import com.xx.pmis.model.Shop;
import com.xx.pmis.persistence.dao.ShopDAO;
import com.xx.pmis.services.ShopService;

public class ShopServiceImpl implements ShopService {
	ShopDAO shopDAO = null;

	public ShopServiceImpl(ShopDAO shopDAO) {
		super();
		this.shopDAO = shopDAO;
	}

	public void saveOrUpdateShop(Shop shop) throws Exception {
		shopDAO.saveOrUpdate(shop);
	}

	public void saveShop(Shop shop) throws Exception {
		shopDAO.save(shop);
	}

	public void deleteShop(Shop shop) throws Exception {
		shopDAO.delete(shop);
	}

	public Shop getShopByShopID(String shopID) throws Exception {
		Shop shop = shopDAO.getShopByShopID(shopID);
		return shop;
	}

	public List<Shop> getAllShop() throws Exception {
		List<Shop> shops = shopDAO.getAllShop();
		return shops;
	}

	public List<Shop> getAllShopByPage(int currentPage, int lineSize) throws Exception {
		List<Shop> shops = shopDAO.getAllShopByPage(currentPage, lineSize);
		return shops;
	}

	public int getCountOfShop() throws Exception {
		return shopDAO.getAllShop().size();
	}
	

	public List<Shop> getAllShopByShopType(String shopType) throws Exception {
		List<Shop> shops = shopDAO.getAllShopByShopType(shopType);
		return shops;
	}


}
